import server from "../server/index";
//获取轮播图
const getSwiper = async () => {
  let { data } = await server.get("https://api.it120.cc/small4/banner/list");
  return data;
};
// 获取砍价的商品
const getWholeshop = async () => {
  let { data } = await server.get(
    "https://api.it120.cc/small4/shop/goods/kanjia/list"
  );
  return data;
};
//进入砍价专栏
const getKanjiashop = async (id) => {
  let { data } = await server.post(
    `https://api.it120.cc/small4/shop/goods/detail?id=${id}`
  );
  return data;
};
//商品专栏的商品
const getSpecial = async () => {
  let { data } = await server.get("https://api.it120.cc/small4/cms/news/list");
  return data;
};
//专栏详情
const getSpecialDetial = async (params) => {
  let { data } = await server.get(
    `https://api.it120.cc/small4/cms/news/detail?id=${params}`
  );
  return data;
};
//用户评论
const getreputation = async (params) => {
  let { data } = await server.post(
    `https://api.it120.cc/small4/shop/goods/reputation?goodsId=${params}`
  );
  return data;
};
//签到
const getSign = async () => {
  let { data } = await server.get(
    "https://api.it120.cc/small4/score/sign/logs"
  );
  return data;
};
const getHitss = async () => {
  let { data } = await server.get(
    "https://api.it120.cc/small4/shop/goods/list?"
  );
  return data;
};
//人气
const getHits = async (aa) => {
  let { data } = await server.get(
    `https://api.it120.cc/small4/shop/goods/list?page=${aa}&pageSize=${4}`
  );
  return data;
};
//登录接口
const getLog = async (uaer, pwd) => {
  let { data } = await server.post(
    `/small4/user/m/login?deviceId=007&deviceName=monkey&mobile=${uaer}&pwd=${pwd}`
  );
  return data;
};
//所有订单列表
const getorder = async (params) => {
  let { data } = await server.post(
    `https://api.it120.cc/small4/order/list?token=${params}`
  );
  return data;
};
//商品分类
const getShop = async () => {
  let { data } = await server.post(
    "https://api.it120.cc/small4/shop/goods/category/all"
  );
  return data;
};
export {
  getSwiper,
  getWholeshop,
  getSpecial,
  getSign,
  getHits,
  getSpecialDetial,
  getLog,
  getorder,
  getShop,
  getKanjiashop,
  getreputation,
  getHitss,
};
